package cn.net.cfss.fgbp.gateway.config;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;


@Component
public class ConfigProperty  implements ApplicationContextAware {
    private static ApplicationContext applicationContext;
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        if (this.applicationContext == null) {
            this.applicationContext = applicationContext;
        }
    }

    @Value("${auth.skip.urls}")
    public String[] skipAuthUrls;


    @Value("${token.expire.time}")
    public Long tokenExpireTime;

    @Value("${application.name}")
    public String appName;

    @Value("${eureka.instance.metadataMap.version:0.0.1}")
    public String appVersion;

    public static ConfigProperty getIns()
    {
        return applicationContext.getBean(ConfigProperty.class);
    }


}
